﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T3Task1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("【1】查询【2】增删改【3】统计");
            int select =int.Parse( Console.ReadLine());
            Console.WriteLine();
            switch (select)
            {
                case 1:
                    Console.WriteLine("欢迎使用查询");
                    Console.WriteLine();
                    string sql = "select * from Games";
                    Console.WriteLine("序号\t游戏名称\t游戏价格\t库存数量");
                    SqlDataReader dr = DBHelper.Select(sql);
                    while (dr.Read())
                    {
                        Console.WriteLine("{0}\t{1}\t{2}\t{3}",dr[0], dr[1], dr[2], dr[3]);
                    }
                    dr.Close();
                    break;
                case 2:
                    Console.WriteLine("欢迎使用增删改");
                    Console.WriteLine();
                    string name = Console.ReadLine();
                    double price = double.Parse(Console.ReadLine());
                    int Stock = int.Parse(Console.ReadLine());
                    string add = "insert into Gamelist (Name,Price,Stock) values('{0}','{1}','{2}') ", name, price;
                    Console.WriteLine();
                    break;
                case 3:
                    Console.WriteLine("欢迎使用统计");
                    Console.WriteLine();
                    break;

            }
        }
    }
}
